<?php
	require '../ini.php';
	require '../../classes/xl_bo_dem.php';
	require '../../classes/xl_hoa_don.php';
	
	$dt_xl_bo_dem = new xl_bo_dem;
	$dt_xl_hoa_don = new xl_hoa_don;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 
	<head>
		
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		
		<title>Admin</title>
		
		<!--                       CSS                       -->
	  
		<!-- Reset Stylesheet -->
		<link rel="stylesheet" href="../skins/sa/resources/css/reset.css" type="text/css" media="screen" />
	  
		<!-- Main Stylesheet -->
		<link rel="stylesheet" href="../skins/sa/resources/css/style.css" type="text/css" media="screen" />
		
		<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
		<link rel="stylesheet" href="../skins/sa/resources/css/invalid.css" type="text/css" media="screen" />	
		
		<!-- Colour Schemes
	  
		Default colour scheme is green. Uncomment prefered stylesheet to use it.
		
		<link rel="stylesheet" href="../skins/sa/resources/css/blue.css" type="text/css" media="screen" />
		
		<link rel="stylesheet" href="../skins/sa/resources/css/red.css" type="text/css" media="screen" />  
	 
		-->
		
		<!-- Internet Explorer Fixes Stylesheet -->
		
		<!--[if lte IE 7]>
			<link rel="stylesheet" href="../skins/sa/resources/css/ie.css" type="text/css" media="screen" />
		<![endif]-->
		
		<!--                       Javascripts                       -->
  
		<!-- jQuery -->
		<script type="text/javascript" src="../skins/sa/resources/scripts/jquery-1.3.2.min.js"></script>
		
		<!-- jQuery Configuration -->
		<script type="text/javascript" src="../skins/sa/resources/scripts/simpla.jquery.configuration.js"></script>
		
		<!-- Facebox jQuery Plugin -->
		<script type="text/javascript" src="../skins/sa/resources/scripts/facebox.js"></script>
		
		<!-- jQuery WYSIWYG Plugin -->
		<script type="text/javascript" src="../skins/sa/resources/scripts/jquery.wysiwyg.js"></script>
		
		<!-- Internet Explorer .png-fix -->
		
		<!--[if IE 6]>
			<script type="text/javascript" src="../skins/sa/resources/scripts/DD_belatedPNG_0.0.7a.js"></script>
			<script type="text/javascript">
				DD_belatedPNG.fix('.png_bg, img, li');
			</script>
		<![endif]-->
        
        
        <!-- Begin -  Highcharts -->
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
		<script type="text/javascript">
		$(function () {
			var chart;
			$(document).ready(function() {
        	chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container',
                zoomType: 'xy'
            },
            title: {
                text: 'Biểu Đồ Thống Kê Lượng Truy Cập - Số phiếu đăng ký'
            },
            subtitle: {
                text: 'Từ ngày <?php echo date('d-m-Y', strtotime('-6 days'))?> đến ngày <?php echo date('d-m-Y')?>'
            },
            xAxis: [{
                categories: [
				<?php
					for($i=6 ; $i>0 ; $i--) {
						echo "'";
						echo date('d-m', strtotime("-$i days"));
						echo "', ";
					}
					
					echo "'";
					echo date('d-m');
					echo "'";
				?>
				]
            }],
            yAxis: [{ // Primary yAxis
                labels: {
                    formatter: function() {
                        return this.value +' Lượt';
                    },
                    style: {
                        color: '#89A54E'
                    }
                },
                title: {
                    text: 'Lượt truy cập',
                    style: {
                        color: '#89A54E'
                    }
                }
            }, { // Secondary yAxis
                title: {
                    text: 'Số phiếu đăng ký',
                    style: {
                        color: '#4572A7'
                    }
                },
                labels: {
                    formatter: function() {
                        return this.value +' PDK';
                    },
                    style: {
                        color: '#4572A7'
                    }
                },
                opposite: true
            }],
            tooltip: {
                formatter: function() {
                    return ''+
                        this.x +': '+ this.y +
                        (this.series.name == 'Số phiếu đăng ký' ? ' PDK' : ' Lượt');
                }
            },
            legend: {
                layout: 'vertical',
                align: 'left',
                x: 120,
                verticalAlign: 'top',
                y: 100,
                floating: true,
                backgroundColor: '#FFFFFF'
            },
            series: [{
                name: 'Số phiếu đăng ký',
                color: '#4572A7',
                type: 'column',
                yAxis: 1,
                data: [
				<?php
					for($i=6 ; $i>0 ; $i--) {

						$ngay =  date('Y-m-d', strtotime("-$i days"));
						echo $dt_xl_hoa_don->so_luong_theo_ngay($ngay);
						
						echo ", ";
					}
				
					$ngay_hien_tai = date('Y-m-d');
					echo $dt_xl_hoa_don->so_luong_theo_ngay($ngay_hien_tai);
					
				?>
				]
    
            }, {
                name: 'Lượng truy cập',
                color: '#89A54E',
                type: 'spline',
                data: [
				<?php
					for($i=6 ; $i>0 ; $i--) {

						$ngay =  date('Y-m-d', strtotime("-$i days"));
						echo $dt_xl_bo_dem->so_luong_theo_ngay($ngay);
						
						echo ", ";
					}
					
					$ngay_hien_tai = date('Y-m-d');
					echo $dt_xl_bo_dem->so_luong_theo_ngay($ngay_hien_tai);
					
				?>
				]
            }]
        });
    });
    
});
		</script>
        <script src="../js/highcharts.js"></script>
		<script src="../js/exporting.js"></script>
        <!-- End -  Highcharts -->
		
	</head>
  
	<body><div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
		
		<?php include '../widgets/sidebar.php'; ?> <!-- End #sidebar -->
		
		<div id="main-content"> <!-- Main Content Section with everything -->
			
			<?php include '../widgets/noscript.php'; ?>
			
			<!-- Page Head -->
			
		  <!-- End .shortcut-buttons-set -->
			
			<div class="clear"></div> <!-- End .clear -->
			
			<div class="content-box"><!-- Start Content Box -->
				
				<div class="content-box-header">
					
					<h3>Trang chủ</h3>
					
					<ul class="content-box-tabs">
						<li><a class="default-tab">Trang chủ</a></li> <!-- href must be unique and match the id of target div -->
						
					</ul>
					
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
			   
					<div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->

					  <div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
						
					</div> <!-- End #tab1 -->
					
					
					
			  </div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box -->
			
			
			<div class="clear"></div>
			
			
			<?php include '../widgets/footer.php'; ?><!-- End #footer -->
			
		</div> <!-- End #main-content -->
		
	</div></body>
  
</html>
